package com.example.template.mapper;

import com.example.template.common.base.BaseMapper;
import com.example.template.entity.User;
import com.example.template.query.UserQuery;
import com.example.template.vo.UserEditModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @className: UserMapper
 * @description: TODO 类描述
 * @author: Kuangkeli
 * @date: 2024/01/18 23:21
 **/
@Primary
public interface UserMapper extends BaseMapper<User> {
    //这里的@Param注解可以用于Mapper.xml取值
     User findUserByUsernameAndPassword(@Param("username") String username ,@Param("password") String password);

     List<User> getAllUser();

     String getRolesByUserId(@Param("user_id") Long userID);

     int updateUserEdit(UserEditModel userEditModel);

     int updateUserRole(@Param("user_id") Long userID , @Param("role_id") Long roleID);

}